import React from "react";
import moment from "moment";
import styles from "./LogColumns.less";

const Columns = (handleDetail) => [
  {
    title: "ID",
    dataIndex: "id",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "所属租户",
    dataIndex: "tenantName",
    render: (text) => <span title={text}>{text}</span>,
  },
  {
    title: "所属应用",
    dataIndex: "appName",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "流程名称",
    dataIndex: "modelName",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "操作类型",
    dataIndex: "action",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "操作人员",
    dataIndex: "operator",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "操作状态",
    dataIndex: "status",
    render: (text) => {
      return <span>{text}</span>;
    },
  },
  {
    title: "操作时间",
    dataIndex: "operatingTime",
    render: (text) => {
      return <span>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</span>;
    },
  },
  {
    title: "操作",
    render: (_, record) => {
      return (
        <span>
          <a className={styles.blue} onClick={() => handleDetail(record)}>
            详情
          </a>
        </span>
      );
    },
  },
];

export default Columns;
